import http from "@/utils/request";

export const GetHome = async () => await http.get("/api/index/index");

export const GetCatalog = async () => await http.post("/api/catalog/index");
export const GetCurrent = async (id) => await http.post(`/api/catalog/current?id=${id}`);

export const getCart = async () => await http.get(`/api/cart/index`);
export const removeCart = async (id) => await http.post(`/api/cart/delete`,{productIds:""+id});
export const addCart = async (good) => await http.post(`/api/cart/add`,good);
export const updateCart = async (good) => await http.post(`/api/cart/update`,good);

export const GetSpecial = async (page,size) => await http.post(`/api/topic/list?page=${page}&size=${size}`);

// zhuw
export const getDataBrand = async(id) => await http.post(`/api/brand/detail?id=${id}`)
export const getProductsDetail = async(id) => await http.post(`/api/goods/detail?id=${id}`)
export const getProductslike = async(id) => await http.post(`/api/goods/related?id=${id}`)